//
//  WCBuildTarget.h
//  WabbitCode
//
//  Created by William Towe on 1/10/09.
//  Copyright 2009 Revolution Software. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "WCTreeNode.h"
#import "NSArray+WCExtensions.h"


typedef enum _WCBTModel {
	WCBTModelTI73 = 0,
	WCBTModelTI82 = 1,
	WCBTModelTI83 = 2,
	WCBTModelTI83P84P = 3,
	WCBTModelTI85 = 4,
	WCBTModelTI86 = 5,
} WCBTModel;

typedef enum _WCBTOutputType {
	WCBTOutputTypeBinary = 0,
	WCBTOutputTypeProgram = 1,
	WCBTOutputTypeProgramIon = 2,
	WCBTOutputTypeProgramMirage = 3,
	WCBTOutputTypeProgramCrASH = 4,
	WCBTOutputTypeApplication = 5,
	WCBTOutputTypeStrings = 6
} WCBTOutputType;

extern NSString *kWCBTActiveBuildConfigurationDidChangeNotification;
extern NSString *kWCBTBuildTargetNameDidChangeNotification;

@class WCBuildConfiguration,WCBuildTargetsGroup;

@interface WCBuildTarget : WCTreeNode <NSCoding, NSCopying, NSMutableCopying> {
	WCBTModel _targetModel;
	WCBTOutputType _targetOutputType;
	BOOL _isTargetActive;
	NSMutableArray *_buildConfigurations;
	NSRect _getInfoWindowFrame;
}

@property (readonly) WCBuildTargetsGroup *buildTargetsGroup;
@property (readwrite, assign) WCBTModel targetModel;
@property (readwrite, assign) WCBTOutputType targetOutputType;
@property (readwrite, assign) BOOL isTargetActive;
@property (readwrite, assign) WCBuildConfiguration *activeBuildConfiguration;
@property (readonly) NSUInteger numberOfBuildConfigurations;
@property (readonly) NSUInteger numberOfBuildSteps;
@property (readonly) NSString *targetModelAsString;
@property (readonly) NSString *targetOutputTypeAsString;
@property (readonly) NSString *defaultNameForModelAndOutputType;
@property (readonly) NSString *outputFileExtension;
@property (readonly) NSMutableArray *buildConfigurations;
@property (readwrite, assign) NSRect getInfoWindowFrame;

+ (id)buildTargetWithModel:(WCBTModel)targetModel outputType:(WCBTOutputType)targetOutputType;
+ (id)buildTargetWithModel:(WCBTModel)targetModel outputType:(WCBTOutputType)targetOutputType active:(BOOL)isTargetActive;

- (id)initWithModel:(WCBTModel)targetModel outputType:(WCBTOutputType)targetOutputType;
- (id)initWithModel:(WCBTModel)targetModel outputType:(WCBTOutputType)targetOutputType active:(BOOL)isTargetActive;

@end
